<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the TableEmails class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single TableEmails object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a TableEmailsMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 * 
	 * @package My Application
	 * @subpackage MetaControls
	 * property-read TableEmails $TableEmails the actual TableEmails data class being edited
	 * property QLabel $IdControl
	 * property-read QLabel $IdLabel
	 * property QTextBox $SubjectControl
	 * property-read QLabel $SubjectLabel
	 * property QTextBox $ContentsControl
	 * property-read QLabel $ContentsLabel
	 * property QTextBox $EmailFromControl
	 * property-read QLabel $EmailFromLabel
	 * property QTextBox $EmailToControl
	 * property-read QLabel $EmailToLabel
	 * property QTextBox $FromUsernameControl
	 * property-read QLabel $FromUsernameLabel
	 * property QTextBox $ToUsernameControl
	 * property-read QLabel $ToUsernameLabel
	 * property QIntegerTextBox $StatusControl
	 * property-read QLabel $StatusLabel
	 * property QDateTimePicker $InsertedDateControl
	 * property-read QLabel $InsertedDateLabel
	 * property QDateTimePicker $SentDateControl
	 * property-read QLabel $SentDateLabel
	 * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class TableEmailsMetaControlGen extends QBaseClass {
		// General Variables
		protected $objTableEmails;
		protected $objParentObject;
		protected $strTitleVerb;
		protected $blnEditMode;

		// Controls that allow the editing of TableEmails's individual data fields
		protected $lblId;
		protected $txtSubject;
		protected $txtContents;
		protected $txtEmailFrom;
		protected $txtEmailTo;
		protected $txtFromUsername;
		protected $txtToUsername;
		protected $txtStatus;
		protected $calInsertedDate;
		protected $calSentDate;

		// Controls that allow the viewing of TableEmails's individual data fields
		protected $lblSubject;
		protected $lblContents;
		protected $lblEmailFrom;
		protected $lblEmailTo;
		protected $lblFromUsername;
		protected $lblToUsername;
		protected $lblStatus;
		protected $lblInsertedDate;
		protected $lblSentDate;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * TableEmailsMetaControl to edit a single TableEmails object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single TableEmails object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableEmailsMetaControl
		 * @param TableEmails $objTableEmails new or existing TableEmails object
		 */
		 public function __construct($objParentObject, TableEmails $objTableEmails) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this TableEmailsMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked TableEmails object
			$this->objTableEmails = $objTableEmails;

			// Figure out if we're Editing or Creating New
			if ($this->objTableEmails->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
		 * edit, or if we are also allowed to create a new one, etc.
		 * 
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableEmailsMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing TableEmails object creation - defaults to CreateOrEdit
 		 * @return TableEmailsMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objTableEmails = TableEmails::Load($intId);

				// TableEmails was found -- return it!
				if ($objTableEmails)
					return new TableEmailsMetaControl($objParentObject, $objTableEmails);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a TableEmails object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new TableEmailsMetaControl($objParentObject, new TableEmails());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableEmailsMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableEmails object creation - defaults to CreateOrEdit
		 * @return TableEmailsMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return TableEmailsMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableEmailsMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableEmails object creation - defaults to CreateOrEdit
		 * @return TableEmailsMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return TableEmailsMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objTableEmails->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QTextBox txtSubject
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtSubject_Create($strControlId = null) {
			$this->txtSubject = new QTextBox($this->objParentObject, $strControlId);
			$this->txtSubject->Name = QApplication::Translate('Subject');
			$this->txtSubject->Text = $this->objTableEmails->Subject;
			$this->txtSubject->MaxLength = TableEmails::SubjectMaxLength;
			return $this->txtSubject;
		}

		/**
		 * Create and setup QLabel lblSubject
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblSubject_Create($strControlId = null) {
			$this->lblSubject = new QLabel($this->objParentObject, $strControlId);
			$this->lblSubject->Name = QApplication::Translate('Subject');
			$this->lblSubject->Text = $this->objTableEmails->Subject;
			return $this->lblSubject;
		}

		/**
		 * Create and setup QTextBox txtContents
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtContents_Create($strControlId = null) {
			$this->txtContents = new QTextBox($this->objParentObject, $strControlId);
			$this->txtContents->Name = QApplication::Translate('Contents');
			$this->txtContents->Text = $this->objTableEmails->Contents;
			$this->txtContents->TextMode = QTextMode::MultiLine;
			return $this->txtContents;
		}

		/**
		 * Create and setup QLabel lblContents
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblContents_Create($strControlId = null) {
			$this->lblContents = new QLabel($this->objParentObject, $strControlId);
			$this->lblContents->Name = QApplication::Translate('Contents');
			$this->lblContents->Text = $this->objTableEmails->Contents;
			return $this->lblContents;
		}

		/**
		 * Create and setup QTextBox txtEmailFrom
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtEmailFrom_Create($strControlId = null) {
			$this->txtEmailFrom = new QTextBox($this->objParentObject, $strControlId);
			$this->txtEmailFrom->Name = QApplication::Translate('Email From');
			$this->txtEmailFrom->Text = $this->objTableEmails->EmailFrom;
			$this->txtEmailFrom->MaxLength = TableEmails::EmailFromMaxLength;
			return $this->txtEmailFrom;
		}

		/**
		 * Create and setup QLabel lblEmailFrom
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblEmailFrom_Create($strControlId = null) {
			$this->lblEmailFrom = new QLabel($this->objParentObject, $strControlId);
			$this->lblEmailFrom->Name = QApplication::Translate('Email From');
			$this->lblEmailFrom->Text = $this->objTableEmails->EmailFrom;
			return $this->lblEmailFrom;
		}

		/**
		 * Create and setup QTextBox txtEmailTo
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtEmailTo_Create($strControlId = null) {
			$this->txtEmailTo = new QTextBox($this->objParentObject, $strControlId);
			$this->txtEmailTo->Name = QApplication::Translate('Email To');
			$this->txtEmailTo->Text = $this->objTableEmails->EmailTo;
			$this->txtEmailTo->MaxLength = TableEmails::EmailToMaxLength;
			return $this->txtEmailTo;
		}

		/**
		 * Create and setup QLabel lblEmailTo
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblEmailTo_Create($strControlId = null) {
			$this->lblEmailTo = new QLabel($this->objParentObject, $strControlId);
			$this->lblEmailTo->Name = QApplication::Translate('Email To');
			$this->lblEmailTo->Text = $this->objTableEmails->EmailTo;
			return $this->lblEmailTo;
		}

		/**
		 * Create and setup QTextBox txtFromUsername
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtFromUsername_Create($strControlId = null) {
			$this->txtFromUsername = new QTextBox($this->objParentObject, $strControlId);
			$this->txtFromUsername->Name = QApplication::Translate('From Username');
			$this->txtFromUsername->Text = $this->objTableEmails->FromUsername;
			$this->txtFromUsername->MaxLength = TableEmails::FromUsernameMaxLength;
			return $this->txtFromUsername;
		}

		/**
		 * Create and setup QLabel lblFromUsername
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblFromUsername_Create($strControlId = null) {
			$this->lblFromUsername = new QLabel($this->objParentObject, $strControlId);
			$this->lblFromUsername->Name = QApplication::Translate('From Username');
			$this->lblFromUsername->Text = $this->objTableEmails->FromUsername;
			return $this->lblFromUsername;
		}

		/**
		 * Create and setup QTextBox txtToUsername
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtToUsername_Create($strControlId = null) {
			$this->txtToUsername = new QTextBox($this->objParentObject, $strControlId);
			$this->txtToUsername->Name = QApplication::Translate('To Username');
			$this->txtToUsername->Text = $this->objTableEmails->ToUsername;
			$this->txtToUsername->MaxLength = TableEmails::ToUsernameMaxLength;
			return $this->txtToUsername;
		}

		/**
		 * Create and setup QLabel lblToUsername
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblToUsername_Create($strControlId = null) {
			$this->lblToUsername = new QLabel($this->objParentObject, $strControlId);
			$this->lblToUsername->Name = QApplication::Translate('To Username');
			$this->lblToUsername->Text = $this->objTableEmails->ToUsername;
			return $this->lblToUsername;
		}

		/**
		 * Create and setup QIntegerTextBox txtStatus
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtStatus_Create($strControlId = null) {
			$this->txtStatus = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtStatus->Name = QApplication::Translate('Status');
			$this->txtStatus->Text = $this->objTableEmails->Status;
			$this->txtStatus->Required = true;
			return $this->txtStatus;
		}

		/**
		 * Create and setup QLabel lblStatus
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblStatus_Create($strControlId = null, $strFormat = null) {
			$this->lblStatus = new QLabel($this->objParentObject, $strControlId);
			$this->lblStatus->Name = QApplication::Translate('Status');
			$this->lblStatus->Text = $this->objTableEmails->Status;
			$this->lblStatus->Required = true;
			$this->lblStatus->Format = $strFormat;
			return $this->lblStatus;
		}

		/**
		 * Create and setup QDateTimePicker calInsertedDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calInsertedDate_Create($strControlId = null) {
			$this->calInsertedDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calInsertedDate->Name = QApplication::Translate('Inserted Date');
			$this->calInsertedDate->DateTime = $this->objTableEmails->InsertedDate;
			$this->calInsertedDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calInsertedDate;
		}

		/**
		 * Create and setup QLabel lblInsertedDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblInsertedDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblInsertedDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblInsertedDate->Name = QApplication::Translate('Inserted Date');
			$this->strInsertedDateDateTimeFormat = $strDateTimeFormat;
			$this->lblInsertedDate->Text = sprintf($this->objTableEmails->InsertedDate) ? $this->objTableEmails->InsertedDate->__toString($this->strInsertedDateDateTimeFormat) : null;
			return $this->lblInsertedDate;
		}

		protected $strInsertedDateDateTimeFormat;


		/**
		 * Create and setup QDateTimePicker calSentDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calSentDate_Create($strControlId = null) {
			$this->calSentDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calSentDate->Name = QApplication::Translate('Sent Date');
			$this->calSentDate->DateTime = $this->objTableEmails->SentDate;
			$this->calSentDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calSentDate;
		}

		/**
		 * Create and setup QLabel lblSentDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblSentDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblSentDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblSentDate->Name = QApplication::Translate('Sent Date');
			$this->strSentDateDateTimeFormat = $strDateTimeFormat;
			$this->lblSentDate->Text = sprintf($this->objTableEmails->SentDate) ? $this->objTableEmails->SentDate->__toString($this->strSentDateDateTimeFormat) : null;
			return $this->lblSentDate;
		}

		protected $strSentDateDateTimeFormat;




		/**
		 * Refresh this MetaControl with Data from the local TableEmails object.
		 * @param boolean $blnReload reload TableEmails from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objTableEmails->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objTableEmails->Id;

			if ($this->txtSubject) $this->txtSubject->Text = $this->objTableEmails->Subject;
			if ($this->lblSubject) $this->lblSubject->Text = $this->objTableEmails->Subject;

			if ($this->txtContents) $this->txtContents->Text = $this->objTableEmails->Contents;
			if ($this->lblContents) $this->lblContents->Text = $this->objTableEmails->Contents;

			if ($this->txtEmailFrom) $this->txtEmailFrom->Text = $this->objTableEmails->EmailFrom;
			if ($this->lblEmailFrom) $this->lblEmailFrom->Text = $this->objTableEmails->EmailFrom;

			if ($this->txtEmailTo) $this->txtEmailTo->Text = $this->objTableEmails->EmailTo;
			if ($this->lblEmailTo) $this->lblEmailTo->Text = $this->objTableEmails->EmailTo;

			if ($this->txtFromUsername) $this->txtFromUsername->Text = $this->objTableEmails->FromUsername;
			if ($this->lblFromUsername) $this->lblFromUsername->Text = $this->objTableEmails->FromUsername;

			if ($this->txtToUsername) $this->txtToUsername->Text = $this->objTableEmails->ToUsername;
			if ($this->lblToUsername) $this->lblToUsername->Text = $this->objTableEmails->ToUsername;

			if ($this->txtStatus) $this->txtStatus->Text = $this->objTableEmails->Status;
			if ($this->lblStatus) $this->lblStatus->Text = $this->objTableEmails->Status;

			if ($this->calInsertedDate) $this->calInsertedDate->DateTime = $this->objTableEmails->InsertedDate;
			if ($this->lblInsertedDate) $this->lblInsertedDate->Text = sprintf($this->objTableEmails->InsertedDate) ? $this->objTableEmails->InsertedDate->__toString($this->strInsertedDateDateTimeFormat) : null;

			if ($this->calSentDate) $this->calSentDate->DateTime = $this->objTableEmails->SentDate;
			if ($this->lblSentDate) $this->lblSentDate->Text = sprintf($this->objTableEmails->SentDate) ? $this->objTableEmails->SentDate->__toString($this->strSentDateDateTimeFormat) : null;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC TABLEEMAILS OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's TableEmails instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveTableEmails() {
			try {
				// Update any fields for controls that have been created
				if ($this->txtSubject) $this->objTableEmails->Subject = $this->txtSubject->Text;
				if ($this->txtContents) $this->objTableEmails->Contents = $this->txtContents->Text;
				if ($this->txtEmailFrom) $this->objTableEmails->EmailFrom = $this->txtEmailFrom->Text;
				if ($this->txtEmailTo) $this->objTableEmails->EmailTo = $this->txtEmailTo->Text;
				if ($this->txtFromUsername) $this->objTableEmails->FromUsername = $this->txtFromUsername->Text;
				if ($this->txtToUsername) $this->objTableEmails->ToUsername = $this->txtToUsername->Text;
				if ($this->txtStatus) $this->objTableEmails->Status = $this->txtStatus->Text;
				if ($this->calInsertedDate) $this->objTableEmails->InsertedDate = $this->calInsertedDate->DateTime;
				if ($this->calSentDate) $this->objTableEmails->SentDate = $this->calSentDate->DateTime;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the TableEmails object
				$this->objTableEmails->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's TableEmails instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteTableEmails() {
			$this->objTableEmails->Delete();
		}		



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'TableEmails': return $this->objTableEmails;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to TableEmails fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'SubjectControl':
					if (!$this->txtSubject) return $this->txtSubject_Create();
					return $this->txtSubject;
				case 'SubjectLabel':
					if (!$this->lblSubject) return $this->lblSubject_Create();
					return $this->lblSubject;
				case 'ContentsControl':
					if (!$this->txtContents) return $this->txtContents_Create();
					return $this->txtContents;
				case 'ContentsLabel':
					if (!$this->lblContents) return $this->lblContents_Create();
					return $this->lblContents;
				case 'EmailFromControl':
					if (!$this->txtEmailFrom) return $this->txtEmailFrom_Create();
					return $this->txtEmailFrom;
				case 'EmailFromLabel':
					if (!$this->lblEmailFrom) return $this->lblEmailFrom_Create();
					return $this->lblEmailFrom;
				case 'EmailToControl':
					if (!$this->txtEmailTo) return $this->txtEmailTo_Create();
					return $this->txtEmailTo;
				case 'EmailToLabel':
					if (!$this->lblEmailTo) return $this->lblEmailTo_Create();
					return $this->lblEmailTo;
				case 'FromUsernameControl':
					if (!$this->txtFromUsername) return $this->txtFromUsername_Create();
					return $this->txtFromUsername;
				case 'FromUsernameLabel':
					if (!$this->lblFromUsername) return $this->lblFromUsername_Create();
					return $this->lblFromUsername;
				case 'ToUsernameControl':
					if (!$this->txtToUsername) return $this->txtToUsername_Create();
					return $this->txtToUsername;
				case 'ToUsernameLabel':
					if (!$this->lblToUsername) return $this->lblToUsername_Create();
					return $this->lblToUsername;
				case 'StatusControl':
					if (!$this->txtStatus) return $this->txtStatus_Create();
					return $this->txtStatus;
				case 'StatusLabel':
					if (!$this->lblStatus) return $this->lblStatus_Create();
					return $this->lblStatus;
				case 'InsertedDateControl':
					if (!$this->calInsertedDate) return $this->calInsertedDate_Create();
					return $this->calInsertedDate;
				case 'InsertedDateLabel':
					if (!$this->lblInsertedDate) return $this->lblInsertedDate_Create();
					return $this->lblInsertedDate;
				case 'SentDateControl':
					if (!$this->calSentDate) return $this->calSentDate_Create();
					return $this->calSentDate;
				case 'SentDateLabel':
					if (!$this->lblSentDate) return $this->lblSentDate_Create();
					return $this->lblSentDate;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to TableEmails fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'SubjectControl':
						return ($this->txtSubject = QType::Cast($mixValue, 'QControl'));
					case 'ContentsControl':
						return ($this->txtContents = QType::Cast($mixValue, 'QControl'));
					case 'EmailFromControl':
						return ($this->txtEmailFrom = QType::Cast($mixValue, 'QControl'));
					case 'EmailToControl':
						return ($this->txtEmailTo = QType::Cast($mixValue, 'QControl'));
					case 'FromUsernameControl':
						return ($this->txtFromUsername = QType::Cast($mixValue, 'QControl'));
					case 'ToUsernameControl':
						return ($this->txtToUsername = QType::Cast($mixValue, 'QControl'));
					case 'StatusControl':
						return ($this->txtStatus = QType::Cast($mixValue, 'QControl'));
					case 'InsertedDateControl':
						return ($this->calInsertedDate = QType::Cast($mixValue, 'QControl'));
					case 'SentDateControl':
						return ($this->calSentDate = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>